package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.constant.MessageConstant;
import com.itheima.entity.Result;

import com.itheima.pojo.Role;

import com.itheima.service.RoleService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

@RestController
@RequestMapping("/role")
public class RoleController {
    @Reference
    private RoleService roleService;

    /**
     * 查看全部检查组的信息
     *  checkgroud/findAllGroup
     */
    @RequestMapping("/findAllGroup")
    public Result findAllGroup(){
        try{
            List<Role> listGroup= roleService.findAllGroup();
            return new Result(true, MessageConstant.QUERY_CHECKGROUP_SUCCESS,listGroup);
        }catch (Exception e){
            return  new Result(false,MessageConstant.QUERY_CHECKGROUP_FAIL);
        }
    }
}
